/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.dakaqi.entities;

import cn.dakaqi.entities.user.User;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;

//JPA标识
@Entity
@Table(name = "U_TASK")

public class Task extends IdEntity
{

	private static final long serialVersionUID = -3373715753775647275L;
	private String title;
	private String description;
	private User user;

	// JSR303 BeanValidator的校验规则
	@NotBlank
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	// JPA 基于USER_ID列的多对一关系定义
	@ManyToOne
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	//    @Override
//    public String toString() {
//        return ToStringBuilder.reflectionToString(this);
//    }
}
